;(function(win){
	var utils = win.utils = {};
	
	//ui
	var ui = utils.ui = {};
	
	//显示消息框
	ui.showPopMsg = function(msg){
		var ele = $('<div style="text-align:center;width:100%;position:fixed;bottom: 0.5rem;"><span style="padding:0.1rem 0.3rem;max-width:50%;background-color:#666;opacity: 0.85;color:#fff;border-radius: 0.1rem;"></span></div>')
				  .appendTo(document.body);
		ele.find('span').text(msg);
		
		setTimeout(function(){
			ele.remove();
		},3000);
	}
	
	var href = utils.href = {};
	href.go = function(url){
		history.pushState({url:url},null);
		location.href=url;
	}
	
	href.goBack = function(url){
		var referrer = document.referrer;
		if(referrer && referrer.indexOf('pass.buildnet.cn')!=-1){
			location.href = url;
		}else{
			history.back();
		}
	}
	
	win.addEventListener("popstate",function(e){
		var referrer = e.currentTarget.document.referrer;
		if(referrer && referrer.indexOf('pass.buildnet.cn')!=-1){
			location.href = url;
		}else{
			if(e.state && e.state.url){
				href.go(e.state.url);
			}else{
				href.go(url);
			}
		}
        console.log(e);
    },false);  
})(window);